package com.capgemini.task.service;

import com.capgemini.core.AppContext;
import com.capgemini.task.domain.ScheduleJobRunLog;
import com.capgemini.wechat.service.SaleOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by annson on 2016/8/8.
 */
public class SaveLogThread extends Thread {
    private static Logger log = LoggerFactory.getLogger(SaveLogThread.class);
    private ScheduleJobRunLog scheduleJobRunLog;

    public SaveLogThread(ScheduleJobRunLog scheduleJobRunLog) {
        this.scheduleJobRunLog = scheduleJobRunLog;
    }

    @Override
    public void run(){
        log.info("start save order schedule run log.....");
        JobTaskService jobTaskService = AppContext.getBean(JobTaskService.class);
        jobTaskService.saveRunLog(scheduleJobRunLog);

        log.info("save order schedule run log end.");
    }
}
